
import {service} from "./baseapi"


/**
 * 获取摄像头状态
 * @returns Promise<any>
 */
export function GetCamaraStatus() {
  return service({
    url: "/api/CamaraData/getCamaraStatus",
    method: "get",
    params: {}
  });
}

/**
 * 添加线路配置
 * @param data 配置数据
 * @returns Promise<any>
 */
export function AddLineConfig(data: any) {
  return service({
    url: "/api/C1/addLineConfig",
    method: "put",
    data: data
  });
}

/**
 * 获取配置列表
 * @returns Promise<any>
 */
export function GetConfigList() {
  return service({
    url: "/api/C1/getLineConfigList",
    method: "get",
    params: {}
  });
}

/**
 * 编辑线路配置
 * @param data 配置数据
 * @returns Promise<any>
 */
export function EditLineConfig(data: any) {
  return service({
    url: "/api/C1/editLineConfig",
    method: "post",
    data: data  // 修复：POST请求应使用data而不是params
  });
}
/**
 * 删除线路配置
 * @param Id 配置ID
 * @returns Promise<any>
 */
export function DelLineConfig(Id: number) {
  return service({
    url: "/api/C1/delLineConfig",
    method: "delete",
    params: {
      Id: Id
    }
  });
}

/**
 * 使用线路配置
 * @param data 配置数据
 * @returns Promise<any>
 */
export function UseLineConfig(data: any) {
  return service({
    url: "/api/C1/useLineConfig",
    method: "post",
    data: data  // 修复：POST请求应使用data而不是params
  });
}
/**
 * 获取报警数量
 * @returns Promise<any>
 */
export function GetPoliceNum() {
  return service({
    url: "/api/C1/getPoliceNum",
    method: "get",
    params: {}
  });
}

/**
 * 获取报警数据（分页）
 * @param page 页码
 * @param pageSize 每页数量，默认10
 * @returns Promise<any>
 */
export function GetPoliceData(page: number, pageSize: number = 10) {
  return service({
    url: "/api/C1/getPoliceData",
    method: "get",
    params: {
      page: page,
      number: pageSize
    }
  });
}

/**
 * 检查最新报警信息
 * @returns Promise<any>
 */
export function CheckLatestPolice() {
  return service({
    url: "/api/C1/checkLatestPolice",
    method: "get",
    params: {}
  });
}